import base from "./base.js"

export default (url, data = {}, method = 'GET') => {
	return new Promise((resolve, reject) => {
		uni.request({
			url: base.host + url,   //小程序请求
			//url,  //H5请求 因为有跨域问题，直接请求地址即可，无需域名
			method,
			data,
			success: (res) => {
				resolve(res.data);
			},
			fail: (err) => {
				reject(err);
			}
		});
	})
}